const express = require("express");
const router = express.Router();
// 导入验证数据的中间件
const validate = require("../middleware/validate");
// 导入需要的验证规则对象
const { reg_login_schema } = require("../schema/user");

// 导入用户模块
const userRouter = require("../router_handle/user");

// 注册
router.post("/register", validate(reg_login_schema.body), userRouter.register);

// 登录
router.post("/login", validate(reg_login_schema.body), userRouter.login);

module.exports = router;
